/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ticks.chromedome.subsystems;

import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.command.Subsystem;
import ticks.chromedome.RobotMap;

/**
 *
 * @author Jared
 */
public class Suspension extends Subsystem {
    private static Suspension instance=null;
    private DoubleSolenoid front;
    private DoubleSolenoid back;
    public static boolean retracted = false;
    public static boolean extended = true;
    
    public static Suspension getInstance(){
        if(instance==null){
            instance = new Suspension();
        }
        return instance;
    }
    
    private Suspension(){
        front = new DoubleSolenoid(RobotMap.SUSP_FRONT_EXTEND, RobotMap.SUSP_FRONT_RETRACT);
        back = new DoubleSolenoid(RobotMap.SUSP_REAR_EXTEND, RobotMap.SUSP_REAR_RETRACT);
    }
    
    
    public void suspensionFront(boolean state){
        if(state==true){
            front.set(DoubleSolenoid.Value.kForward);
        }
        else{
            front.set(DoubleSolenoid.Value.kReverse);
        }
    }
    
     public void suspensionRear(boolean state){
        if(state==true){
            back.set(DoubleSolenoid.Value.kForward);
        }
        else{
            back.set(DoubleSolenoid.Value.kReverse);
        }
    }
    // Put methods for controlling this subsystem
    // here. Call these from Commands.

    public void initDefaultCommand() {
        // Set the default command for a subsystem here.
        //setDefaultCommand(new MySpecialCommand());
    }
}
